package com.empresa.rhtutorial.controller.jsf.funcionarioauditoria;

import javax.enterprise.inject.Produces;
import javax.inject.Named;


import com.empresa.rhtutorial.entity.funcionario.FuncionarioEntity;
import com.empresa.rhtutorial.controller.jsf.AppMB;
import javax.inject.Inject;
import com.empresa.rhtutorial.facade.funcionarioauditoria.IPlcFacade;

import com.powerlogic.jcompany.commons.annotation.PlcUriIoC;
import com.powerlogic.jcompany.commons.config.stereotypes.SPlcMB;
import com.powerlogic.jcompany.controller.jsf.annotations.PlcHandleException;
import com.powerlogic.jcompany.controller.jsf.PlcEntityList;
import com.powerlogic.jcompany.config.collaboration.FormPattern;

import com.powerlogic.jcompany.config.collaboration.PlcConfigFormLayout;
import com.powerlogic.jcompany.config.collaboration.PlcConfigForm;
import com.powerlogic.jcompany.config.collaboration.PlcConfigReport;
import com.powerlogic.jcompany.config.collaboration.PlcConfigSelection;



import com.powerlogic.jcompany.config.aggregation.PlcConfigAggregation;

@PlcConfigAggregation(
		entity = com.empresa.rhtutorial.entity.funcionario.FuncionarioEntity.class
 )

@PlcConfigForm (
	selection = @PlcConfigSelection(apiQuerySel = "querySelRel"),
	formPattern=FormPattern.Rel,
	formLayout = @PlcConfigFormLayout(dirBase="/WEB-INF/fcls/funcionariorel"),
	report=@PlcConfigReport(reportFile="auditor/funcionarioAuditoria.rptdesign")
)

/**
 * Classe de Controle gerada pelo assistente
 */
 
@SPlcMB
@PlcUriIoC("funcionarioauditoria")
@PlcHandleException
public class FuncionarioAuditoriaMB extends AppMB  {

	private static final long serialVersionUID = 1L;
	
	@Inject
	IPlcFacade iPlcFacade;

     		
	/**
	* Entidade da ação injetado pela CDI
	*/
	@Produces  @Named("funcionarioauditoria")
	public FuncionarioEntity createEntityPlc() {

         if (this.entityPlc==null) {
              this.entityPlc = new FuncionarioEntity();
              this.newEntity();
         }

        return (FuncionarioEntity) this.entityPlc;   
        
	}
	
	/**
	 * Lista de entidades da ação injetado pela CDI
	*/
	@Produces  @Named("funcionarioauditoriaLista")
	public PlcEntityList createEntityListPlc() {
		
		if (this.entityListPlc==null) {
			this.entityListPlc = new PlcEntityList();
			this.newObjectList();
		}
		return this.entityListPlc;
	}		
	
}
